// To parse this JSON data, do
//
//     final lzCategoryProductModel = lzCategoryProductModelFromMap(jsonString);

import 'dart:convert';

List<LzCategoryProductModel> lzCategoryProductModelFromMap(String str) =>
    List<LzCategoryProductModel>.from(json.decode(str).map((x) => LzCategoryProductModel.fromMap(x)));

String lzCategoryProductModelToMap(List<LzCategoryProductModel> data) =>
    json.encode(List<dynamic>.from(data.map((x) => x.toMap())));

class LzCategoryProductModel {
  LzCategoryProductModel({
    this.id,
    this.name,
    this.beMore,
    this.lstCommoSpec,
  });

  String id;
  String name;
  BeMore beMore;
  List<LstCommoSpec> lstCommoSpec;

  factory LzCategoryProductModel.fromMap(Map<String, dynamic> json) => LzCategoryProductModel(
        id: json["id"] == null ? null : json["id"],
        name: json["name"] == null ? null : json["name"],
        beMore: json["beMore"] == null ? null : beMoreValues.map[json["beMore"]],
        lstCommoSpec: json["lstCommoSpec"] == null
            ? null
            : List<LstCommoSpec>.from(json["lstCommoSpec"].map((x) => LstCommoSpec.fromMap(x))),
      );

  Map<String, dynamic> toMap() => {
        "id": id == null ? null : id,
        "name": name == null ? null : name,
        "beMore": beMore == null ? null : beMoreValues.reverse[beMore],
        "lstCommoSpec": lstCommoSpec == null ? null : List<dynamic>.from(lstCommoSpec.map((x) => x.toMap())),
      };
}

enum BeMore { N, Y }

final beMoreValues = EnumValues({
  "N": BeMore.N,
  "Y": BeMore.Y,
});

class LstCommoSpec {
  LstCommoSpec({
    this.id,
    this.name,
    this.type,
    this.typeName,
    this.imgUrl,
    this.inPrice,
    this.outPrice,
    this.isReBuy,
    this.groupSpecType,
    this.hadShopCt,
    this.kuCunAllCt,
    this.commodityState,
    this.giftRemark,
    this.memberIsLessBuy,
    this.memberLessBuyBili,
  });

  String id;
  String name;
  Type type;
  TypeName typeName;
  String imgUrl;
  String inPrice;
  String outPrice;
  BeMore isReBuy;
  String groupSpecType;
  String hadShopCt;
  String kuCunAllCt;
  CommodityState commodityState;
  String giftRemark;
  BeMore memberIsLessBuy;
  String memberLessBuyBili;

  factory LstCommoSpec.fromMap(Map<String, dynamic> json) => LstCommoSpec(
        id: json["id"] == null ? null : json["id"],
        name: json["name"] == null ? null : json["name"],
        type: json["type"] == null ? null : typeValues.map[json["type"]],
        typeName: json["typeName"] == null ? null : typeNameValues.map[json["typeName"]],
        imgUrl: json["imgUrl"] == null ? null : json["imgUrl"],
        inPrice: json["inPrice"] == null ? null : json["inPrice"],
        outPrice: json["outPrice"] == null ? null : json["outPrice"],
        isReBuy: json["isReBuy"] == null ? null : beMoreValues.map[json["isReBuy"]],
        groupSpecType: json["groupSpecType"] == null ? null : json["groupSpecType"],
        hadShopCt: json["hadShopCt"] == null ? null : json["hadShopCt"],
        kuCunAllCt: json["kuCunAllCt"] == null ? null : json["kuCunAllCt"],
        commodityState: json["commodityState"] == null ? null : commodityStateValues.map[json["commodityState"]],
        giftRemark: json["giftRemark"] == null ? null : json["giftRemark"],
        memberIsLessBuy: json["memberIsLessBuy"] == null ? null : beMoreValues.map[json["memberIsLessBuy"]],
        memberLessBuyBili: json["memberLessBuyBili"] == null ? null : json["memberLessBuyBili"],
      );

  Map<String, dynamic> toMap() => {
        "id": id == null ? null : id,
        "name": name == null ? null : name,
        "type": type == null ? null : typeValues.reverse[type],
        "typeName": typeName == null ? null : typeNameValues.reverse[typeName],
        "imgUrl": imgUrl == null ? null : imgUrl,
        "inPrice": inPrice == null ? null : inPrice,
        "outPrice": outPrice == null ? null : outPrice,
        "isReBuy": isReBuy == null ? null : beMoreValues.reverse[isReBuy],
        "groupSpecType": groupSpecType == null ? null : groupSpecType,
        "hadShopCt": hadShopCt == null ? null : hadShopCt,
        "kuCunAllCt": kuCunAllCt == null ? null : kuCunAllCt,
        "commodityState": commodityState == null ? null : commodityStateValues.reverse[commodityState],
        "giftRemark": giftRemark == null ? null : giftRemark,
        "memberIsLessBuy": memberIsLessBuy == null ? null : beMoreValues.reverse[memberIsLessBuy],
        "memberLessBuyBili": memberLessBuyBili == null ? null : memberLessBuyBili,
      };
}

enum CommodityState { CSS_DEPLOY }

final commodityStateValues = EnumValues({"CSS_DEPLOY": CommodityState.CSS_DEPLOY});

enum Type { CST_NON_TE_4_DS }

final typeValues = EnumValues({"CST_NON_TE_4_DS": Type.CST_NON_TE_4_DS});

enum TypeName { EMPTY }

final typeNameValues = EnumValues({"农特产品": TypeName.EMPTY});

class EnumValues<T> {
  Map<String, T> map;
  Map<T, String> reverseMap;

  EnumValues(this.map);

  Map<T, String> get reverse {
    if (reverseMap == null) {
      reverseMap = map.map((k, v) => new MapEntry(v, k));
    }
    return reverseMap;
  }
}
